<template>
	<view class="homeLayout">
		<view class="banner">
			<swiper indicator-dots :autoplay="true" :interval="3000" :duration="1000" indicator-color="#c8c7cc"
				indicator-active-color="#fff" circular>
				<swiper-item v-for="item in 10">
					<image src="/static/images/huge.png"></image>
				</swiper-item>
			</swiper>
		</view>
		<view class="notice">
			<view class="left">
				<uni-icons type="contact" size="20" color="#28b389"></uni-icons>
				<text>公告</text>
			</view>
			<view class="center">
				<swiper vertical autoplay interval="1500" duration="300" circular>
					<swiper-item v-for="item in 4">
						文字内容xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
					</swiper-item>

				</swiper>
			</view>
			<view class="right">
				<uni-icons type="calendar" size="16" color="#333"></uni-icons>
			</view>
		</view>
		<view class="select">
			<common-title>
				<template #name>
					每日推荐
				</template>
				<template #custom>
					<view class="data">
						<uni-icons type="contact" size="22" color="rgba(120, 172, 153)"></uni-icons>
						<uni-dateformat :date="Date.now()" format="dd"></uni-dateformat>
						<text>日</text>
					</view>
				</template>
			</common-title>
			<scroll-view class="scroll-view_H" scroll-x @scroll="scroll" scroll-left="120">
				<view class="box" v-for="item in 10">
					<image src="/static/images/logo.png"></image>
				</view>
			</scroll-view>
		</view>
		<view class="theme">
			<common-title>
				<template #name>
					每日推荐
				</template>
				<template #custom>
					<navigator url="" class="more">More +</navigator>
				</template>
			</common-title>
			<view class="MoreBox_box">
				<view class="MoreBox_item">
					<common-More></common-More>
				</view>
				<view class="MoreBox_item">
					<common-More></common-More>
				</view>
				<view class="MoreBox_item">
					<common-More></common-More>
				</view>
			</view>


		</view>

	</view>

</template>

<script setup>
	import {
		ref
	} from "vue"
</script>

<style lang="scss">
	.homeLayout {
		.banner {
			width: 750rpx;
			padding: 30rpx 0rpx;

			swiper {
				width: 750rpx;
				height: 340rpx;

				&-item {
					width: 100%;
					height: 100%;
					padding: 0 30rpx;

					image {
						width: 100%;
						height: 100%;
						border-radius: 8rpx;
					}

				}
			}
		}

		.notice {

			width: 690rpx;
			height: 80rpx;
			border-radius: 80rpx;
			margin: auto;
			background: #eee;
			display: flex;

			.left {
				width: 140rpx;
				display: flex;
				justify-content: space-around;
				line-height: 80rpx;
			}

			.center {
				flex: 1;

				swiper {
					height: 100%;

					&-item {
						height: 100%;
						line-height: 83rpx;
						font-size: 30rpx;
						color: #666;
						overflow: hidden;
						white-space: nowrap;
						text-overflow: ellipsis;
					}
				}
			}

			.right {
				width: 70rpx;
				line-height: 80rpx;
			}
		}

		.select {
			width: 730rpx;
			margin: 30rpx;
			padding-right: 30rpx;

			.scroll-view_H {
				white-space: nowrap;
			}

			.box {
				display: inline-block;
				width: 200rpx;
				height: 430rpx;
				margin-right: 15rpx;

				image {
					width: 100%;
					height: 100%;
					border-radius: 15rpx;
				}
			}

			.box:last-child {
				margin-right: 30rpx;
			}

			.data {
				color: rgba(120, 172, 153);
				display: flex;
				align-items: center;
			}
		}

		.theme {
			width: 730rpx;
			margin: 30rpx;
			padding-right: 30rpx;

			.more {
				font-size: 30rpx;
				color: rgba(238, 238, 238);
			}
		}

		.MoreBox_box {
			width: 730rpx;
			// margin: 30rpx;
			padding-right: 30rpx;
			background-color: pink;
			display: flex;
			justify-content: space-between;
		}

		.MoreBox_item {
			width: 200rpx;
			height: 430rpx;
			border-radius: 15rpx;
			background-color: red;
		}
	}
</style>